<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<ui:composition template="/template.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:p="http://primefaces.prime.com.tr/ui"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets">

	<ui:define name="page">

			<h:form>

				<p:pickList var="city" value="#{pickListBean.cities}"
					itemLabel="#{city}" itemValue="#{city}">
					<f:facet name="sourceCaption">Equipes</f:facet>
					<f:facet name="targetCaption">Campeonato</f:facet>
				</p:pickList>
				<p:commandButton value="Inserir" update="displayCities"	oncomplete="cityDialog.show()" />
				<p:dialog modal="true" showEffect="fade" hideEffect="fade" widgetVar="cityDialog">
					<h:panelGrid id="displayCities" columns="2">
						<h:outputText value="fonte: " style="font-weight:bold" />
						<ui:repeat value="#{pickListBean.cities.source}" var="item">
							<h:outputText value="#{item}" style="margin-right:5px" />
						</ui:repeat>

						<h:outputText value="enviados: " style="font-weight:bold" />
						<ui:repeat value="#{pickListBean.cities.target}" var="item">
							<h:outputText value="#{item}" style="margin-right:5px" />
						</ui:repeat>
					</h:panelGrid>
				</p:dialog>
			</h:form>

	</ui:define>
</ui:composition>
